package com.ruoyi.web.core.config;

import com.ruoyi.web.Interceptord.FcfIntercepter;
import com.ruoyi.web.Interceptord.TraceInterceptor;
import com.ruoyi.web.Interceptord.XzxInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    //解决无法获得redis的问题
    @Bean
    public TraceInterceptor getTraceInterceptor(){
        return new TraceInterceptor();
    }

    @Bean
    public FcfIntercepter getTraceInterceptor2(){
        return new FcfIntercepter();
    }
    @Bean
    public XzxInterceptor getTraceInterceptor3(){
        return new XzxInterceptor();
    }


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(getTraceInterceptor()).addPathPatterns("/**");
//        registry.addInterceptor(getTraceInterceptor2()).addPathPatterns("/**");
//        registry.addInterceptor(getTraceInterceptor3()).addPathPatterns("/**");
    }



}
